Data reliability is a problem in the telecommunications and mass storage fields, where wireless transmissions are susceptible to errors due to signal degradation and where mass storage media routinely encounter read or write errors. In general, the mass storage media may include hard disks, NAND and NOR flash memory, and other types of non-volatile memory. To improve data reliability, Error Correction Code (ECC) algorithms have been developed to detect and to correct bit errors within blocks of data. ECC algorithms typically include the transmission or storage of redundant data, which does not convey information.
“Hamming Codes” refer to a class of ECC algorithms that can be used to detect and correct data errors. Hamming codes are widely used for error detection and correction in digital communications systems and in data storage systems. Another well-known ECC algorithm is the “Reed-Solomon code”, widely used for error correction in the hard drive and compact disk industries. The Reed-Solomon codes may be used to correct multiple errors per block of data.
Generally, when a block of data is to be written to a memory or transmitted over a communication channel, an ECC engine calculates parity data based on the data. Both the data and the associated parity data are written to the memory or transmitted over the communication channel. When the data is accessed from the memory or received from the communication channel, the ECC engine calculates parity data based on the accessed data, and compares the calculated parity data to the stored parity data. If a difference is detected, the ECC engine determines which bits are in error and may take steps to correct the bits or flag the errors to the rest of the system so as to initiate an error recover mechanism like requesting a retransmission over the communication channel or rereading the data from the memory.
Generally, the ECC algorithms are designed to operate on a block of data of a particular size. When a block of data that is stored in a mass storage device does not match the particular size, padding bits or padding data are often appended to the payload data to produce a block of data of the right size for the ECC algorithm. Since the padding data is added before the ECC process, the padding data adds to the number of cycles and the processing time required to decode the data.